<?php
!defined('IN_APP') && exit('Access Denied');
require(APP_ROOT.'library/smarty/Smarty.class.php');

/**
 * Enter description here ...
 * @author kaireewu
 *
 */
class Template extends Smarty
{
    public function __construct()
    {
        // Class Constructor.
        // These automatically get set with each new instance.
        parent::__construct();
        $this->template_dir = APP_ROOT . 'templates/';
        $this->compile_dir = APP_ROOT . 'data/templates_c/';
        $this->config_dir = APP_ROOT . 'data/config/';
        $this->cache_dir = APP_ROOT . 'data/cache/tpl/';
        $this->caching = Smarty::CACHING_OFF;
        //$this->caching = Smarty::CACHING_LIFETIME_CURRENT;
    }
    
    public function assign_all(array $vars) {
    	foreach($vars as $key => $value) {
    		$this->assign($key, $value);
    	}
    }
}